﻿namespace CsharpHomework06
{
    internal class Program
    {
        /// <summary>
        /// 输出10000以内有多少个质数
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            //从1~1000，挨个检验

            int number = 0;
            int Primenumber = 0;
            for (int i = 1;i<=1000;i++)
            {
                //检验每一个数的因数
                for(int j = 2;j<i;j++)
                {
                    if(i%j==0)
                    {
                        number++;
                        break;
                    }
                    
                }
            }
            //1不是质数
            Primenumber=1000-number-1;
            Console.WriteLine(Primenumber);
        }
    }
}
